/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "language")
@NamedQueries({
    @NamedQuery(name = "Language.findAll", query = "SELECT l FROM Language l"),
    @NamedQuery(name = "Language.findByIdlanguage", query = "SELECT l FROM Language l WHERE l.idlanguage = :idlanguage"),
    @NamedQuery(name = "Language.findByLanguage", query = "SELECT l FROM Language l WHERE l.language = :language"),
    @NamedQuery(name = "Language.findByCodelanguage", query = "SELECT l FROM Language l WHERE l.codelanguage = :codelanguage")})
public class Language implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idlanguage")
    private Integer idlanguage;
    @Column(name = "language")
    private String language;
    @Column(name = "codelanguage")
    private String codelanguage;
    @OneToMany(mappedBy = "language", fetch = FetchType.LAZY)
    private List<Recordlevelelement> recordlevelelementList;

    public Language() {
    }

    public Language(Integer idlanguage) {
        this.idlanguage = idlanguage;
    }

    public Integer getIdlanguage() {
        return idlanguage;
    }

    public void setIdlanguage(Integer idlanguage) {
        this.idlanguage = idlanguage;
    }

    public String getLanguage() {
        return language;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public String getCodelanguage() {
        return codelanguage;
    }

    public void setCodelanguage(String codelanguage) {
        this.codelanguage = codelanguage;
    }

    public List<Recordlevelelement> getRecordlevelelementList() {
        return recordlevelelementList;
    }

    public void setRecordlevelelementList(List<Recordlevelelement> recordlevelelementList) {
        this.recordlevelelementList = recordlevelelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idlanguage != null ? idlanguage.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Language)) {
            return false;
        }
        Language other = (Language) object;
        if ((this.idlanguage == null && other.idlanguage != null) || (this.idlanguage != null && !this.idlanguage.equals(other.idlanguage))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Language[idlanguage=" + idlanguage + "]";
    }

}
